-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fixed the issue where using built-in functions in PromptTemplate caused validation failures, and added a method:skipValidate() to skip validation for PromptTemplate. #2458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… caused validation failures, and added a method:skipValidate() to skip validation for PromptTemplate. Signed-off-by: Sun Yuhan <[email protected]>
spring-ai-core/src/main/java/org/springframework/ai/chat/prompt/PromptTemplate.java
Outdated
Show resolved
Hide resolved
…n the constructor. Signed-off-by: Sun Yuhan <[email protected]>
Signed-off-by: Sun Yuhan <[email protected]>
@sunyuhan1998 Thanks for your contribution! #2780 introduced a new Would that address the case where built-in functions are used and the validation needs to be skipped? |
Hi, @ThomasVitale! |
This change is still good, but needs to be updated to reflect the changes to switching to a TemplateRenderer interface. The StringTemplate implementation is in |
Hi! @markpollack |
Hi! @markpollack |
forgot to close. Thanks @sunyuhan1998 additional changes in 0e15197 |
As mentioned in #2456, when using
PromptTemplate
, if the template contains certain built-in functions, it fails validation duringrender()
. I made the following two fixes and optimizations:org.stringtemplate.v4.compiler.Compiler#funcs
, I skip the validation of these built-in functions.skipValidate()
method to allow users to actively skip this validation.